home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Tele / A / Apple PowerBook Internal Script < prev   
Encoding:
Text File  |  1992-02-12  |  3.1 KB  |  93 lines  |  [TEXT/MSWD]

  1. !
  2. !    Liaison 3.0.2 script for the Apple PowerBook Internal modem.
  3. !
  4. !    Copyright © 1992, Farallon Computing, Inc.  All rights reserved.
  5. !  revision 1.0 3/13/92 FK 
  6. !
  7. !
  8.     Name    "PowerBook Internal"                        ! what the user sees
  9. !
  10. !
  11. !    Common entry point - dispatch on the current and future state.  Cases are:
  12. !
  13. !        1)    Off-hook, ending a connection and releasing the modem
  14. !        2)    On-hook,  preparing to answer (i.e. awaiting a call)
  15. !        3)    Off-Hook, ending a connection and resuming answer wait
  16. !        4)    On-hook,  initiating a call
  17. !
  18. 10    IfVar    1    1    20                            ! if off-hook, signal modem
  19.     IfnVar    1    3    30                            ! otherwise, skip around
  20. !
  21. !    We're off-hook, so try to hang up the modem by dropping DTR momentarily.
  22. !    (This will work if the modem remembers its &D2 setting)
  23. !
  24. 20    DtrOff                                        ! drop DTR to hang up
  25.     Wait    2                                    ! wait up to 2 sec for response
  26.     DtrOn                                        ! restore DTR
  27. !
  28. !    If the modem did not respond, use the dumb attention sequence.
  29. !
  30.     IfVar    0    15    30                            ! branch if modem responded
  31.     Pause    66                                    ! quiet for 1.1 sec
  32.     Xmit            "+++"                        ! send the attention command
  33.     Wait    2                                    ! wait up to 2 sec for response
  34. !
  35. !    Configure the generic Hayes 2400 modem options, including DTR control.
  36. !
  37. 30    SerReset 0                                    ! restore user-defined speed
  38.     Xmit            "AT &F\13"    ! generic modem setup
  39.     Wait    5                        ! wait for the response
  40.     Xmit            "AT E0 Q0 S0=0 V1 X4 H\13"    ! generic modem setup
  41.     Wait    2                                    ! wait for the response
  42. !
  43. !    Lastly, configure the Intenal modem features and modem responses.
  44. !
  45.     Xmit            "AT N1 W2 &K4 &Q5 S36=7 S37=6 S11=50\13" ! anySpeed noProgr Xon/OFF ErrorCtl
  46.     Wait    2                                    ! wait for the response
  47. !
  48. !    If not just hanging up, define the responses we'll accept.
  49. !
  50.     IfVar    1    1    50                            ! if we're just hanging up
  51.     Match    1    90    "NO CARR"                    ! redefine termination event
  52.     Match    2    80    "CONNECT\13"                ! define activation events
  53.     Match    3    80    "T 12"                        ! "CONNECT 1200"
  54.     Match    4    80    "T 24"                        ! "CONNECT 2400"
  55.     Match    5    80    "T 48"                        ! "CONNECT 4800"
  56.     Match    6    80    "T 96"                        ! "CONNECT 9600"
  57.     Match    7    80    "T 19"                        ! "CONNECT 19.2"
  58.     Match    8    80    "T 38"                        ! "CONNECT 38.4"
  59. !
  60. !    To allow Answering, let the modem go off-hook on the 1st ring.
  61. !
  62.     IfVar    1    4    60                            ! if we're initiating a call
  63. 40    Xmit            "AT S0=1\13"                ! go off-hook on 1st ring
  64. 50    Exit                                        ! then wait for a response
  65. !
  66. !    To place a call, issue the phone number and wait for a response.
  67. !
  68. 60    Match    10    70    "NO DIAL"                    ! define modem abort events
  69.     Match    11    70    "BUSY"                        !
  70.     Match    12    70    "NO AN"                        ! "NO ANSWER"
  71.     Xmit            "AT DT "                    ! touch-tone dial
  72.     Dial                                        ! the user phone number
  73.     Xmit            "\13"                        ! with a terminating EOL
  74.     Exit                                        ! then wait for a response
  75. !
  76. !    On receipt of a dialing abort message, begin a teardown.
  77. !
  78. 70    Hangup    0                                    ! result is message value
  79. !
  80. !    On receipt of "Connect", begin arbitration.
  81. !
  82. 80    Match    1    90    "NO CARR"                    ! drop all the other strings
  83.     Pause    6                                    ! let the line settle down
  84.     Carrier    0                                    ! we have carrier per msg
  85.     Connect                                        ! result is "Connected at xxxx"
  86. !
  87. !    On receipt of "No Carrier", begin a teardown.
  88. !
  89. 90    Hangup    1                                    ! result is "failed to connect"
  90. !
  91. !    SCRIPT END
  92. !
  93.